/**
 * 
 * 
 * @author Tyler Bishop
 * @version 1.3
 */
package com.BlackMesa.controllers;

import com.BlackMesa.models.Task;
import com.google.android.maps.GeoPoint;

import junit.framework.TestCase;
import android.test.InstrumentationTestRunner;
import android.util.Log;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.*;
import com.BlackMesa.database.*;

public class TodoListActivity extends Activity {
    /** Called when the activity is first created. */
	LoginViewController loginViewController;
	ListViewController lvc;
	
    public void onCreate(Bundle savedInstanceState) {

    	DatabaseAdapter adapter = new DatabaseAdapter(this);

        loginViewController = new LoginViewController(this, adapter);  


        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);
    	loginViewController.init();

    }

	/**
	 * 
	 * @param menu
	 * @return
	 */
	public boolean onCreateOptionsMenu(Menu menu){
		MenuInflater inflator = getMenuInflater();
		inflator.inflate(R.layout.task_menu, menu);
		return true;
	}
	
	/**
	 * 
	 * @param item
	 * @return
	 */
	public boolean onOptionsItemSelected(MenuItem item){
		switch(item.getItemId()){
		case(R.id.logout):
			setContentView(R.layout.main);
    		loginViewController.init();
			break;
		case(R.id.mapView):
			Intent myIntent = new Intent(this.getBaseContext(), MapActive.class);
        	startActivityForResult(myIntent, 0);
			break;
		}
		return true; 
	}
  
    
    
}